<div class="signin">
    <div class="left">
    	<img src="<?=STATIC_PATH?>Image/index_bg.jpg">
    </div>
    <div class="right">
    	<div class="signin">
    		<div class="main_title">欢迎登录Eshifang</div>
    		<div class="title">邮箱:</div>
    		<div><input id="email" class="input" type="text"></div>
    		<div class="title">密码:</div>
    		<div><input id="password" class="input" type="password"></div>
    		<div class="func"><input id="signin_btn" class="signin_btn btn_input" type="button" value="登 录"><a href="http://<?=HOST?>/signup">注册</a><a href="#">忘记密码？</a></div>
    		<div>要么旅行，要么读书，身体和灵魂必须有一个在路上&#8230;&#8230;</div>
    	</div>
    </div>
</div>
<script type="text/javascript">
	$("#email").focus();
	$("#signin_btn").click(function (){
		var email = $.trim($("#email").val());
		var password = $.trim($("#password").val());
		$.ajax({
			  url: "http://<?=HOST?>/signin/doAjax",
			  cache: false,
			  timeout:10000,
			  type: "POST",
			  data: {
				email:email,
				password:password
			  },
			  dataType: "json",
			  beforeSend: function() {
				  disableHTML(true, '请稍等，登录中……', true);
			  },
			  success: function(data) {
				  if(data.errCode != 0){
					  disableHTML(true, data.errMsg, false);
					  setTimeout(disableHTML,2000);
				  	if(data.errCode == -2){
				  		$("#password").focus();
				  	}else{
				  		$("#email").focus();
				  	}
				  }else{
					disableHTML(true, '登录成功，跳转中……', true);
					setTimeout("location.href = 'http://<?=HOST?>/'",2000);
				  }
			  },
			  error:function(){
	      			disableHTML(true, "请求出错，请重试", false);
	      			setTimeout(disableHTML,2000);
	      		}
			});
		});
</script>